import {createRouter, createWebHistory} from 'vue-router'
import LoginView from '../views/Login/AuthView.vue'
import index from '../views/IndexView.vue'
import LoginC from '../components/login.vue'
import RegisterC from '../components/register.vue'


// @ts-ignore
const router = createRouter({
    history: createWebHistory(import.meta.env.BASE_URL), routes: [{
        path: '/', name: 'index', component: index
    }, {
        path: '/auth', component: LoginView, children: [{
            path: 'login', component: LoginC
        }, {
            path: 'register', component: RegisterC
        }]
    }, {
        path: '/doctor', component: () => {
            return import('@/views/manager/managerView.vue')
        }, children: [{
            //患者就诊
            path: 'rescue-info', component: () => {
                return import('@/views/manager/rescue-info/index.vue')
            }
        }, {
            path: 'scheduling-info', component: () => {
                return import('@/views/manager/scheduling-info/index.vue')
            }
        }, {
            path: 'appointment-info', component: () => {
                return import('@/views/manager/appointment-info/index.vue')
            }
        }, {
            path: 'online-ask', component: () => {
                return import('@/views/manager/online-ask/index.vue')
            }
        }, {
            path: 'patient-info', component: () => import('@/views/manager/patient-info/index.vue')
        }, {
            path: 'case-info', component: () => import('@/views/manager/case-info/index.vue')
        }, {
            path: 'user-info', component: () => import('@/views/manager/user-info/index.vue')
        }, {
            path: 'auth-status', component: () => {
                return import('@/views/manager/auth-status/index.vue')
            }
        }]
    }]
})

export default router
